<script setup lang="ts" name="CCChildPage_Props">
import { ref } from "vue";

const toy = ref("凹凸慢");

//defineProps(["car", "sendToy"]);
defineProps<{ car: string; sendToy: (toy: string) => void }>();
</script>

<template>
  <div class="bg-orange-100 p-6 my-6">
    <h2 class="text-xl">子组件</h2>
    <div>玩具：{{ toy }}</div>
    <div>父组件的车：{{ car }}</div>
    <div>
      <button @click="sendToy(toy)" class="px-1 py-0.5 border bg-gray-50">
        把玩具给父组件
      </button>
    </div>
  </div>
</template>
